
*******************************************************************************
***   For appendix: endogenous estimates (OLS)
*******************************************************************************

**********************************
***   Economics and interest   ***
**********************************

local economic economic_index employed assets basic_necessities 

est clear

foreach var of varlist `economic' {
	
	display " "
	display " "
	display " "
	display "Table A13a: `var'"
	
	quietly eststo: areg `var' school4 $controls if birthyear_control >= 1970 & birthyear_control <= 1997, absorb(locale_gender) cluster(locale_3_control)
	
	noisily: lincom school4
	quietly: summ `var'
	estadd scalar vmean = r(mean)
}

local information information interest_pub_affairs_index discuss_pol_index news_scale

foreach var of varlist `information' {
	
	display " "
	display " "
	display " "
	display "Table A13b: `var'"
	
	quietly eststo: areg `var' school4 $controls if birthyear_control >= 1970 & birthyear_control <= 1997, absorb(locale_gender) cluster(locale_3_control)
	
	noisily: lincom school4
	quietly: summ `var'
	estadd scalar vmean = r(mean)
}

local numbers "& (1) & (2) & (3) & (4) \\"
local economic "\textbf{A: Economic} & \multicolumn{1}{c}{Economic index} &  \multicolumn{1}{c}{Employed}  &  \multicolumn{1}{c}{Assets index}  &  \multicolumn{1}{c}{Basic necessities index} \\  \midrule"
local interest "\midrule \\ \textbf{B: Interest} & \multicolumn{1}{c}{Interest index} &  \multicolumn{1}{c}{Interest in pub affairs}  &  \multicolumn{1}{c}{Discuss politics}  &  \multicolumn{1}{c}{News index} \\  \midrule"
local gap ""

esttab est1 est2 est3 est4 using "tables/econ_interest_ols.tex", replace b(3) se(3) ar(3) ///
stats(N vmean, fmt(0 3 3 "") labels(`"Observations"' `"DV Mean"')) nonumber posthead("`numbers'" "`economic'") ///
f label nomtitles nogaps booktabs noobs compress star(* 0.10 ** 0.05 *** 0.01) keep(school4)

esttab est5 est6 est7 est8 using "tables/econ_interest_ols.tex", b(3) se(3) ar(3) ///
stats(N vmean, fmt(0 3 3 "") labels(`"Observations"' `"DV Mean"')) ///
nonumber posthead("`gap'" "`interest'")  postfoot("\midrule") append ///
f label nomtitles nogaps booktabs noobs compress star(* 0.10 ** 0.05 *** 0.01) keep(school4)




*************************
***   Participation   ***
*************************

local participation participation_index participate_index contact_index 

est clear

foreach var of varlist `participation' {
	
	display " "
	display " "
	display " "
	display "Table A13c: `var'"
	
	quietly eststo: areg `var' school4 $controls if birthyear_control >= 1970 & birthyear_control <= 1997, absorb(locale_gender) cluster(locale_3_control)
	
	noisily: lincom school4
	quietly: summ `var'
	estadd scalar vmean = r(mean)
}

local participation1 "\textbf{C: Participation} & \multicolumn{1}{c}{Participation index} &  \multicolumn{1}{c}{Participate index} &  \multicolumn{1}{c}{Contact index} \\  \midrule"


esttab est1 est2 est3 using "tables/participation_ols.tex", replace b(3) se(3) ar(3) ///
stats(N vmean, fmt(0 3 3 "") labels(`"Observations"' `"DV Mean"')) nonumber posthead("`participation1'") postfoot("\midrule") ///
f label nomtitles nogaps booktabs noobs compress star(* 0.10 ** 0.05 *** 0.01) keep(school4)



************************************
***   Government and Democracy   ***
************************************


local democracy dem_gov dem_support dem_checks_on_pres dem_institutions
est clear


foreach var of varlist `democracy' {
	
	display " "
	display " "
	display " "
	display "Table A13d: `var'"
	
	quietly eststo: areg `var' school4 $controls if birthyear_control >= 1970 & birthyear_control <= 1997, absorb(locale_gender) cluster(locale_3_control)
	
	noisily: lincom school4
	quietly: summ `var'
	estadd scalar vmean = r(mean)
}

local dem1 "\textbf{D: Support for Democracy} & \multicolumn{1}{c}{Democratic} &  \multicolumn{1}{c}{Dem support}&  \multicolumn{1}{c}{Checks on} &  \multicolumn{1}{c}{Dem institutions} \\ "
local line2 "& \multicolumn{1}{c}{quality index} &  \multicolumn{1}{c}{index}&  \multicolumn{1}{c}{president} &  \multicolumn{1}{c}{index} \\  \midrule"
local gap ""

esttab est1 est2 est3 est4 using "tables/democracy_ols.tex", replace b(3) se(3) ar(3) ///
stats(N vmean, fmt(0 3 3 "") labels(`"Observations"' `"DV Mean"')) nonumber posthead("`dem1'"  "`line2'") ///
f label nomtitles nogaps booktabs noobs compress star(* 0.10 ** 0.05 *** 0.01) keep(school4)


